<!DOCTYPE html>
<html >
<head>
<script>
    window.onload=function (){
        var oBtn1=document.getElementById('btn1');
        //var oUl=document.getElementById('ul1');
        var aChk=document.getElementsByTagName('input');

        oBtn1.onclick=function (){
            if(this.checked){
                for (var i=0; i<aChk.length; i++)
                {
                    aChk[i].checked=true;
                }
            }else{
                for (var i=0; i<aChk.length; i++)
                {
                    aChk[i].checked=false;
                }
            }
        };
    };
</script>
</head>

<body>
<input type="checkbox" id="btn1" />


    <input type="checkbox" />
    <input type="checkbox" />
<input type = 'text' />
    <input type="checkbox" />
    <input type="checkbox" />
    <input type="checkbox" />
<input type = 'radio' checked />
</body>
</html>